cmake_minimum_required(VERSION 3.10)
project(SumoRTI)

set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DELPP_THREAD_SAFE")
set(CMAKE_CXX_STANDARD 11)

add_subdirectory(lib)

include_directories(
        $ENV{RTI_ROOT}/include
        $ENV{SUMO_HOME}/src
        ${CMAKE_CURRENT_SOURCE_DIR}/lib/include)

link_directories(
        $ENV{RTI_ROOT}/lib
        $ENV{SUMO_HOME}/bin
        ${CMAKE_CURRENT_SOURCE_DIR}/lib/lib)

set(CMAKE_RUNTIME_OUTPUT_DIRECTORY_DEBUG ${CMAKE_CURRENT_SOURCE_DIR}/bin/Debug)
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY_RELEASE ${CMAKE_CURRENT_SOURCE_DIR}/bin/Release)

set(CMAKE_EXPORT_COMPILE_COMMANDS ON)

file(COPY ${CMAKE_CURRENT_SOURCE_DIR}/Resource/Config/ DESTINATION ${CMAKE_CURRENT_SOURCE_DIR}/bin/${CMAKE_BUILD_TYPE})

file(GLOB_RECURSE SRC "src/*.*" "src/hwFederateAmbassador/*.*" "src/utils/*.cpp")

add_executable(sumo_rti ${SRC})

target_link_libraries(sumo_rti SumoRtiLib RTI-NG fedtime pthread sumocpp)
